package cn.weiyan.dtx.tccdemo.bank1.spring;

import org.dromara.hmily.annotation.Hmily;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author misterWei
 * @create 2020年02月14号:17点45分
 * @mailbox mynameisweiyan@gmail.com
 */
@FeignClient(value = "tcc-demo-bank2",fallback = Bank2ClientFallback.class)
public interface Bank2Client {

    // 远程调用必须加上  @Hmily 注解 ,否则分支事务无法获取到全局事务ID 造成事务无法同步.
    @GetMapping("/bank2/transfer")
    @Hmily
    public Boolean transfer(@RequestParam("amount") Double amount);
}
